//引入接口：
import { secklist } from '../../../request/api'
const state = {
    secklist: []
}

const getters = {
    getSeck(state) {
        return state.secklist
    }
}

const mutations = {
    REQ_LIST(state, payload) {
        state.secklist = payload
    }
}
const actions = {
    getSeckActions({ commit }) {
        secklist()
            .then(res => {
                console.log(res, '菜单列表')
                if (res.code == 200) {
                    commit('REQ_LIST', res.list ? res.list : [])
                }
            })
    }
}


export default {
    state,
    mutations,
    actions,
    getters,
    //开启命名空间
    namespaced: true
}